package com.controller;

import com.entity.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/selectOne")
    public String selectOne(String userName,String password){
        User u=userService.selectOne(userName,password);
        if (u!=null){
            return "redirect:/selectAll.do";
        }else {
            return "loginError";
        }
    }
}
